﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ReclutamientoCosea
{
    /// <summary>
    /// Interaction logic for usrNavegadorWeb.xaml
    /// </summary>
    public partial class usrNavegadorWeb : UserControl
    {
        public event CerroVentana SeCerroVentana;
        public usrNavegadorWeb()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(usrNavegadorWeb_Loaded);            
        }

        void usrNavegadorWeb_Loaded(object sender, RoutedEventArgs e)
        {
            // Get URI to navigate to
            Uri uri = new Uri("http://www.coseanet.com", UriKind.RelativeOrAbsolute);

            // Only absolute URIs can be navigated to.
            try
            {
                // Navigate to the desired URL by calling the .Navigate method
                this.wNavegador.Navigate(uri);
            }
            catch (Exception ex)
            {
                wExcepcionesSistema wError = new wExcepcionesSistema();
                wError.txtExcepcion.Text = ex.Message;
                wError.ShowDialog();
            }
        }

        private void btnSalir_Click(object sender, RoutedEventArgs e)
        {
            SeCerroVentana(true);
        }
    }
}
